import { AppRouteRecordRaw } from '../utils/utils'
import { RoutesAlias } from '../routesAlias'
import { routeModules } from './modules/example'
import { AppRouteRecord } from '@/types'

/**
 * 静态路由配置（不需要权限就能访问的路由）
 * isHideTab: true 表示不在标签页中显示
 *
 * 注意事项：
 * 1、path、name 不要和动态路由冲突，否则会导致路由冲突无法访问
 * 2、静态路由不管是否登录都可以访问
 */
export const staticRoutes: AppRouteRecordRaw[] = [
  // 不需要登录就能访问的路由示例
  // {
  //   path: '/welcome',
  //   name: 'WelcomeStatic',
  //   component: () => import('@views/dashboard/console/index.vue'),
  //   meta: { title: 'menus.dashboard.title' }
  // },
  {
    path: RoutesAlias.Login,
    name: 'Login',
    component: () => import('@views/auth/login/index.vue'),
    meta: { title: 'menus.login.title', isHideTab: true }
  },
  {
    path: RoutesAlias.Register,
    name: 'Register',
    component: () => import('@views/auth/register/index.vue'),
    meta: { title: 'menus.register.title', isHideTab: true }
  },
  {
    path: RoutesAlias.ForgetPassword,
    name: 'ForgetPassword',
    component: () => import('@views/auth/forget-password/index.vue'),
    meta: { title: 'menus.forgetPassword.title', isHideTab: true }
  },
  {
    path: '/403',
    name: 'Exception403',
    component: () => import('@views/exception/403/index.vue'),
    meta: { title: '403' }
  },
  {
    path: '/:pathMatch(.*)*',
    name: 'Exception404',
    component: () => import('@views/exception/404/index.vue'),
    meta: { title: '404' }
  },
  {
    path: '/500',
    name: 'Exception500',
    component: () => import('@views/exception/500/index.vue'),
    meta: { title: '500' }
  },
  {
    path: '/outside',
    component: () => import('@views/layout/index.vue'),
    name: 'Outside',
    meta: { title: 'menus.outside.title' },
    children: [
      // iframe 内嵌页面
      {
        path: '/outside/iframe/:path',
        name: 'Iframe',
        component: () => import('@/views/outside/Iframe.vue'),
        meta: { title: 'iframe' }
      }
    ]
  }
]




/**
 *
 * 后端路由模式-静态路由配置（不需要权限就能访问的路由并显示左侧菜单）
 *
 * 属性说明：
 * isHideTab: true 表示不在标签页中显示
 *
 * 注意事项：
 * 1、path、name 不要和动态路由冲突，否则会导致路由冲突无法访问
 * 2、静态路由不管是否登录都可以访问
 */
export const localRoutes: AppRouteRecord[] = [
  // 示例嵌套路由定义
  // {
  //   name: 'Test',
  //   path: '/test',
  //   component: RoutesAlias.Layout,
  //   meta: {
  //     base: 'admin',
  //     order: 999,
  //     title: '测试路由',
  //     icon: '&#xe721;',
  //     roles: []
  //   },
  //   children: [
  //     {
  //       path: '/123',
  //       name: 'test123',
  //       component: '/dashboard/console',
  //       meta: {
  //         base: 'admin',
  //         title: 'test123',
  //         keepAlive: false,
  //         fixedTab: true
  //       },
  //       children: []
  //     },
  //     {
  //       path: '/1234',
  //       name: 'test1234',
  //       component: '/dashboard/analysis',
  //       meta: {
  //         title: 'test1234',
  //         keepAlive: false
  //       },
  //       children: []
  //     }
  //   ]
  // },
  routeModules
]
